package cn.broadsense.thrid.param;

import cn.broadsense.thrid.result.EvPlanTaskResult;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author pengxin
 * @date 2022-10-09 16:35
 */
@NoArgsConstructor
@Data
public class EvUpPlantTaskParam extends BaseParam{


    private String planTaskName;
    private Integer analysisType;
    private List<ChannelAlgorithmInfosParam> channelAlgorithmInfos;
    private Integer channelIntervalSecond;
    private OrchestrationParam orchestration;

    @Override
    public void checkParam() {

    }

    @Override
    public Class getResultClass() {
        return EvPlanTaskResult.class;
    }

    @NoArgsConstructor
    @Data
    public static class OrchestrationParam {
        private String orchestrationType;
        private DisposableParam disposable;
        private List<AnalysisPeriodsParam> analysisPeriods;
        private CycleParam cycle;
        private PollingParam polling;

        @NoArgsConstructor
        @Data
        public static class DisposableParam {
            private String startDate;
            private String endDate;
        }

        @NoArgsConstructor
        @Data
        public static class CycleParam {
            private List<Integer> dayOfWeek;
        }

        @NoArgsConstructor
        @Data
        public static class PollingParam {
            private Boolean enable;
            private Integer pollingInterval;
            private Integer pollingCount;
        }

        @NoArgsConstructor
        @Data
        public static class AnalysisPeriodsParam {
            private String startTime;
            private String endTime;
        }
    }

    @NoArgsConstructor
    @Data
    public static class ChannelAlgorithmInfosParam {
        private String channelCode;
        private String channelName;
        private String gpCode;
        private String algorithmId;
        private String config;
    }
}
